def sum(n):
    sums = 0
    for i in n:
        if isinstance(i, list):
            sums += sum(i)  #题目中说层数不限于两层，所以使用递归
        if isinstance(i, tuple):
            sums += sum(i)
        if isinstance(i, int):
            sums += i
        if isinstance(i, float):
            sums += i
    return sums
a = eval(input())
print(sum(a))